package com.liduanwei.update.util

import java.io.FileInputStream
import java.io.FileOutputStream
import java.lang.Exception
import java.util.*

/**
 * Created by Wei on 17/10/3.
 */

class PropertiesUtil {
    companion object {
        fun loadProperties(propertiesFile: String): Properties {
            var properties = Properties()
            try {
                val inputStream = FileInputStream(propertiesFile)
                properties.load(inputStream)
                inputStream.close()
            } catch (ex: Exception) {
                ex.printStackTrace()
            }

            return properties
        }

        fun storeProperties(properties: Properties, propertiesFile: String) {
            properties.store(FileOutputStream(propertiesFile), "")
        }
    }

}